include $(ERP_BASE_PATH)/comm/makefile.comm.v2

INSTALL_PATH = /usr/local/c2csvc/update
INCLUDE = -I../XXO -I../include \
          -I./ \
          -I../src \
          -I$(ERP_BASE_PATH)/gis/export_include \
          -I$(ERP_BASE_PATH)/comm/export_include/ \
          -I$(ERP_BASE_PATH)/comm/export_include/c2cplatform \
          -I$(ERP_BASE_PATH)/comm/export_include/app_platform \
          -I$(ERP_BASE_PATH)/comm/export_include/c2cplatform/component \
		  		  

	  
LIB = -L$(ERP_BASE_PATH)/comm/$(LIB_PATH) -L$(ERP_BASE_PATH)/gis/export_lib_suse64/ -L/usr/lib64 \
        $(LOG2_LIB) $(ITIL_LIB)  $(UTIL_LIB) $(TCONV_LIB) $(JSONCPP_LIB) $(WEB_LIB) \
        -lcomm_http_custorm \
        -lcurl

OUTPUT = ao_gis_mapgateway_soso.so ao_gis_mapgateway_soso2.so ao_gis_mapgateway_baidu.so \
	ao_gis_mapgateway_google.so ao_gis_mapgateway_aliyun.so ao_gis_mapgateway_gaode.so

VPATH = ../lib

SOURCES = gismapgatewayao.cpp \
		gismapgatewayao_adaptor.cpp \
		gismap_handler.cpp \
		gismap_globalconfig.cpp
		
OBJECTS=$(SOURCES:.cpp=.o)

all:$(OUTPUT) 

.SUFFIXES: .o .cpp
.cpp.o:
	$(CXX) $(CPPFLAGS) $(INCLUDE) -c $(filter %.cpp, $^) 

.o:
	$(CXX) $(CPPFLAGS) $(INCLUDE) -o $@ $^ 

$(OUTPUT): $(OBJECTS)
	$(CXX) $(CFLAGS) -fPIC -shared -o $@ $^ $(LIB)

clean:
	rm -f *.o *.so *.~ *.bak

install:
	cp -f $(OUTPUT) $(INSTALL_PATH)

installrpm:
	sudo cp -vf ao_gis_mapgateway_soso.so /data/rpm_data_64bit/icson/icson_ao_gis_mapgateway_soso_1/build_directory/usr/local/c2csvc/so/
	sudo cp -vf ao_gis_mapgateway_soso2.so /data/rpm_data_64bit/icson/icson_ao_gis_mapgateway_soso2_1/build_directory/usr/local/c2csvc/so/
	sudo cp -vf ao_gis_mapgateway_baidu.so /data/rpm_data_64bit/icson/icson_ao_gis_mapgateway_baidu_1/build_directory/usr/local/c2csvc/so/
	sudo cp -vf ao_gis_mapgateway_google.so /data/rpm_data_64bit/icson/icson_ao_gis_mapgateway_google_1/build_directory/usr/local/c2csvc/so/
	sudo cp -vf ao_gis_mapgateway_aliyun.so /data/rpm_data_64bit/icson/icson_ao_gis_mapgateway_aliyun_1/build_directory/usr/local/c2csvc/so/
	sudo cp -vf ao_gis_mapgateway_gaode.so /data/rpm_data_64bit/icson/icson_ao_gis_mapgateway_gaode_1/build_directory/usr/local/c2csvc/so/
						
dep:
	mkdep -p$(VPATH) $(INCLUDE) $(SOURCES) > .depend

ifneq ($(wildcard .depend),)
include .depend
endif
